from textual.app import ComposeResult
from textual.screen import Screen
from textual.widgets import Header, Footer, Markdown

from pathlib import Path
from typing_extensions import Final

SPARK_STORE_MD: Final[str] = \
    (Path(__file__).parent.parent.parent / "welcome.md").read_text()

class MainScreen(Screen):
    '''主屏幕显示内容'''

    CSS_PATH = 'main_screen.tcss'

    def compose(self) -> ComposeResult:
        yield Header(show_clock=True)
        yield Markdown(SPARK_STORE_MD, classes="column")
        yield Footer()

    def on_mount(self) -> None:
        self.notify(title='提示',message='欢迎使用星火应用商店终端版')
